<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>排行榜</title>
    <style>
        body{
            display: flex;
            justify-content: center;
            box-sizing: border-box;
            font-family: Arial, sans-serif;
            align-items: center;
            min-height: 100vh; /* 使容器占据整个视口的高度 */
            margin: 0;
            padding: 0;
        }
        .rankListTable {

            border: 1px solid black;
            border-collapse: collapse;

        }

        .rankListContainer h1{
            text-align: center;
        }
        .rankListTable td{
            width: 100px;
            height: 100px;
            text-align : center;
            border: 1px solid black;
            border-collapse: collapse;
        }

        .rankListACBlock {
            background-color: #39fba5;
        }

        .rankListWABlock {
            background-color: #ff4f4f;
        }
    </style>
</head>
<body>

<div class="rankListContainer">
    <h1 th:text="${contest.title}+'排行榜'"></h1>
<table class="rankListTable">
    <tr>
        <td>名称</td>
        <td>解题数</td>
        <td>总耗时</td>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
        <td>E</td>
    </tr>
    <tr th:each="ranklist:${ranklists}">
        <td th:text="${ranklist.username}"></td>
        <td th:text="${ranklist.ranklist.rightcount}"></td>
        <td th:text="${ranklist.ranklist.totalcost}"></td>
        <td th:if="${ranklist.ranklist.problemAstatus eq 0}" class="rankListNONEBlock"> - </td>
        <td th:if="${ranklist.ranklist.problemAstatus eq 1}" class="rankListACBlock"> AC </td>
        <td th:if="${ranklist.ranklist.problemAstatus eq 2}" class="rankListWABlock"> WA
            <font th:if="${ranklist.ranklist.problemAaddcost > 0}" th:utext="'<br>+('+${ranklist.ranklist.problemAaddcost}+')'"></font></td>
        <td th:if="${ranklist.ranklist.problemBstatus eq 0}" class="rankListNONEBlock"> - </td>
        <td th:if="${ranklist.ranklist.problemBstatus eq 1}" class="rankListACBlock"> AC </td>
        <td th:if="${ranklist.ranklist.problemBstatus eq 2}" class="rankListWABlock"> WA
            <font th:if="${ranklist.ranklist.problemBaddcost > 0}" th:utext="'<br>+('+${ranklist.ranklist.problemBaddcost}+')'"></font></td>
        <td th:if="${ranklist.ranklist.problemCstatus eq 0}" class="rankListNONEBlock"> - </td>
        <td th:if="${ranklist.ranklist.problemCstatus eq 1}" class="rankListACBlock"> AC </td>
        <td th:if="${ranklist.ranklist.problemCstatus eq 2}" class="rankListWABlock"> WA
            <font th:if="${ranklist.ranklist.problemCaddcost > 0}" th:utext="'<br>+('+${ranklist.ranklist.problemCaddcost}+')'"></font></td>
        <td th:if="${ranklist.ranklist.problemDstatus eq 0}" class="rankListNONEBlock"> - </td>
        <td th:if="${ranklist.ranklist.problemDstatus eq 1}" class="rankListACBlock"> AC </td>
        <td th:if="${ranklist.ranklist.problemDstatus eq 2}" class="rankListWABlock"> WA
            <font th:if="${ranklist.ranklist.problemDaddcost > 0}" th:utext="'<br>+('+${ranklist.ranklist.problemDaddcost}+')'"></font></td>
        <td th:if="${ranklist.ranklist.problemEstatus eq 0}" class="rankListNONEBlock"> - </td>
        <td th:if="${ranklist.ranklist.problemEstatus eq 1}" class="rankListACBlock"> AC </td>
        <td th:if="${ranklist.ranklist.problemEstatus eq 2}" class="rankListWABlock"> WA
            <font th:if="${ranklist.ranklist.problemEaddcost > 0}" th:utext="'<br>+('+${ranklist.ranklist.problemEaddcost}+')'"></font></td>

    </tr>
</table>
<table>
    <tr>
        <td ><a th:if="${nowPage gt 0}" th:href="@{'/problemlist/list?page='+ ${nowPage-1} }">上一页</a></td>
        <td th:text="@{'第'+${nowPage+1}+'页'}"></td>
        <td ><a th:if="${nowPage lt totalPage-1}" th:href="@{'/problemlist/list?page='+ ${nowPage+1} }">下一页</a></td>
    </tr>
</table>
</div>
</body>
</html>